home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / Resources.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  17.0 KB  |  637 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Resources.a
  3. ;
  4. ;    Contains:    Resource Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__RESOURCES__') = 'UNDEFINED' THEN
  18. __RESOURCES__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  24.     include 'MixedMode.a'
  25.     ENDIF
  26.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  27.     include 'Files.a'
  28.     ENDIF
  29.  
  30.  
  31.  
  32. resSysHeap                        EQU        64                    ;System or application heap?
  33. resPurgeable                    EQU        32                    ;Purgeable resource?
  34. resLocked                        EQU        16                    ;Load it in locked?
  35. resProtected                    EQU        8                    ;Protected?
  36. resPreload                        EQU        4                    ;Load in on OpenResFile?
  37. resChanged                        EQU        2                    ;Resource changed?
  38. mapReadOnly                        EQU        128                    ;Resource file read-only
  39. mapCompact                        EQU        64                    ;Compact resource file
  40. mapChanged                        EQU        32                    ;Write map out at update
  41.  
  42. resSysRefBit                    EQU        7                    ;reference to system/local reference
  43. resSysHeapBit                    EQU        6                    ;In system/in application heap
  44. resPurgeableBit                    EQU        5                    ;Purgeable/not purgeable
  45. resLockedBit                    EQU        4                    ;Locked/not locked
  46. resProtectedBit                    EQU        3                    ;Protected/not protected
  47. resPreloadBit                    EQU        2                    ;Read in at OpenResource?
  48. resChangedBit                    EQU        1                    ;Existing resource changed since last update
  49. mapReadOnlyBit                    EQU        7                    ;is this file read-only?
  50. mapCompactBit                    EQU        6                    ;Is a compact necessary?
  51. mapChangedBit                    EQU        5                    ;Is it necessary to write map?
  52.  
  53. kResFileNotOpened                EQU        -1                    ;ref num return as error when opening a resource file
  54. kSystemResFile                    EQU        0                    ;this is the default ref num to the system file
  55.  
  56.     IF ¬ TARGET_OS_MAC THEN
  57. ;  QuickTime 3.0
  58.     ENDIF
  59. ;
  60. ; pascal short InitResources(void )
  61. ;
  62.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  63.         _InitResources:    OPWORD    $A995
  64.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  65.         IMPORT_CFM_FUNCTION InitResources
  66.     ENDIF
  67.  
  68. ;
  69. ; pascal void RsrcZoneInit(void )
  70. ;
  71.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  72.         _RsrcZoneInit:    OPWORD    $A996
  73.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  74.         IMPORT_CFM_FUNCTION RsrcZoneInit
  75.     ENDIF
  76.  
  77. ;
  78. ; pascal void CloseResFile(short refNum)
  79. ;
  80.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  81.         _CloseResFile:    OPWORD    $A99A
  82.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  83.         IMPORT_CFM_FUNCTION CloseResFile
  84.     ENDIF
  85.  
  86. ;
  87. ; pascal OSErr ResError(void )
  88. ;
  89.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  90.         _ResError:    OPWORD    $A9AF
  91.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  92.         IMPORT_CFM_FUNCTION ResError
  93.     ENDIF
  94.  
  95. ;
  96. ; pascal short CurResFile(void )
  97. ;
  98.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  99.         _CurResFile:    OPWORD    $A994
  100.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  101.         IMPORT_CFM_FUNCTION CurResFile
  102.     ENDIF
  103.  
  104. ;
  105. ; pascal short HomeResFile(Handle theResource)
  106. ;
  107.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  108.         _HomeResFile:    OPWORD    $A9A4
  109.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  110.         IMPORT_CFM_FUNCTION HomeResFile
  111.     ENDIF
  112.  
  113. ;
  114. ; pascal void CreateResFile(ConstStr255Param fileName)
  115. ;
  116.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  117.         _CreateResFile:    OPWORD    $A9B1
  118.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  119.         IMPORT_CFM_FUNCTION CreateResFile
  120.     ENDIF
  121.  
  122. ;
  123. ; pascal short OpenResFile(ConstStr255Param fileName)
  124. ;
  125.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  126.         _OpenResFile:    OPWORD    $A997
  127.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  128.         IMPORT_CFM_FUNCTION OpenResFile
  129.     ENDIF
  130.  
  131. ;
  132. ; pascal void UseResFile(short refNum)
  133. ;
  134.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  135.         _UseResFile:    OPWORD    $A998
  136.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  137.         IMPORT_CFM_FUNCTION UseResFile
  138.     ENDIF
  139.  
  140. ;
  141. ; pascal short CountTypes(void )
  142. ;
  143.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  144.         _CountTypes:    OPWORD    $A99E
  145.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  146.         IMPORT_CFM_FUNCTION CountTypes
  147.     ENDIF
  148.  
  149. ;
  150. ; pascal short Count1Types(void )
  151. ;
  152.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  153.         _Count1Types:    OPWORD    $A81C
  154.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  155.         IMPORT_CFM_FUNCTION Count1Types
  156.     ENDIF
  157.  
  158. ;
  159. ; pascal void GetIndType(ResType *theType, short index)
  160. ;
  161.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  162.         _GetIndType:    OPWORD    $A99F
  163.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  164.         IMPORT_CFM_FUNCTION GetIndType
  165.     ENDIF
  166.  
  167. ;
  168. ; pascal void Get1IndType(ResType *theType, short index)
  169. ;
  170.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  171.         _Get1IndType:    OPWORD    $A80F
  172.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  173.         IMPORT_CFM_FUNCTION Get1IndType
  174.     ENDIF
  175.  
  176. ;
  177. ; pascal void SetResLoad(Boolean load)
  178. ;
  179.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  180.         _SetResLoad:    OPWORD    $A99B
  181.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  182.         IMPORT_CFM_FUNCTION SetResLoad
  183.     ENDIF
  184.  
  185. ;
  186. ; pascal short CountResources(ResType theType)
  187. ;
  188.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  189.         _CountResources:    OPWORD    $A99C
  190.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  191.         IMPORT_CFM_FUNCTION CountResources
  192.     ENDIF
  193.  
  194. ;
  195. ; pascal short Count1Resources(ResType theType)
  196. ;
  197.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  198.         _Count1Resources:    OPWORD    $A80D
  199.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  200.         IMPORT_CFM_FUNCTION Count1Resources
  201.     ENDIF
  202.  
  203. ;
  204. ; pascal Handle GetIndResource(ResType theType, short index)
  205. ;
  206.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  207.         _GetIndResource:    OPWORD    $A99D
  208.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  209.         IMPORT_CFM_FUNCTION GetIndResource
  210.     ENDIF
  211.  
  212. ;
  213. ; pascal Handle Get1IndResource(ResType theType, short index)
  214. ;
  215.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  216.         _Get1IndResource:    OPWORD    $A80E
  217.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  218.         IMPORT_CFM_FUNCTION Get1IndResource
  219.     ENDIF
  220.  
  221. ;
  222. ; pascal Handle GetResource(ResType theType, short theID)
  223. ;
  224.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  225.         _GetResource:    OPWORD    $A9A0
  226.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  227.         IMPORT_CFM_FUNCTION GetResource
  228.     ENDIF
  229.  
  230. ;
  231. ; pascal Handle Get1Resource(ResType theType, short theID)
  232. ;
  233.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  234.         _Get1Resource:    OPWORD    $A81F
  235.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  236.         IMPORT_CFM_FUNCTION Get1Resource
  237.     ENDIF
  238.  
  239. ;
  240. ; pascal Handle GetNamedResource(ResType theType, ConstStr255Param name)
  241. ;
  242.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  243.         _GetNamedResource:    OPWORD    $A9A1
  244.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  245.         IMPORT_CFM_FUNCTION GetNamedResource
  246.     ENDIF
  247.  
  248. ;
  249. ; pascal Handle Get1NamedResource(ResType theType, ConstStr255Param name)
  250. ;
  251.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  252.         _Get1NamedResource:    OPWORD    $A820
  253.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  254.         IMPORT_CFM_FUNCTION Get1NamedResource
  255.     ENDIF
  256.  
  257. ;
  258. ; pascal void LoadResource(Handle theResource)
  259. ;
  260.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  261.         _LoadResource:    OPWORD    $A9A2
  262.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  263.         IMPORT_CFM_FUNCTION LoadResource
  264.     ENDIF
  265.  
  266. ;
  267. ; pascal void ReleaseResource(Handle theResource)
  268. ;
  269.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  270.         _ReleaseResource:    OPWORD    $A9A3
  271.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  272.         IMPORT_CFM_FUNCTION ReleaseResource
  273.     ENDIF
  274.  
  275. ;
  276. ; pascal void DetachResource(Handle theResource)
  277. ;
  278.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  279.         _DetachResource:    OPWORD    $A992
  280.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  281.         IMPORT_CFM_FUNCTION DetachResource
  282.     ENDIF
  283.  
  284. ;
  285. ; pascal short UniqueID(ResType theType)
  286. ;
  287.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  288.         _UniqueID:    OPWORD    $A9C1
  289.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  290.         IMPORT_CFM_FUNCTION UniqueID
  291.     ENDIF
  292.  
  293. ;
  294. ; pascal short Unique1ID(ResType theType)
  295. ;
  296.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  297.         _Unique1ID:    OPWORD    $A810
  298.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  299.         IMPORT_CFM_FUNCTION Unique1ID
  300.     ENDIF
  301.  
  302. ;
  303. ; pascal short GetResAttrs(Handle theResource)
  304. ;
  305.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  306.         _GetResAttrs:    OPWORD    $A9A6
  307.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  308.         IMPORT_CFM_FUNCTION GetResAttrs
  309.     ENDIF
  310.  
  311. ;
  312. ; pascal void GetResInfo(Handle theResource, short *theID, ResType *theType, Str255 name)
  313. ;
  314.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  315.         _GetResInfo:    OPWORD    $A9A8
  316.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  317.         IMPORT_CFM_FUNCTION GetResInfo
  318.     ENDIF
  319.  
  320. ;
  321. ; pascal void SetResInfo(Handle theResource, short theID, ConstStr255Param name)
  322. ;
  323.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  324.         _SetResInfo:    OPWORD    $A9A9
  325.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  326.         IMPORT_CFM_FUNCTION SetResInfo
  327.     ENDIF
  328.  
  329. ;
  330. ; pascal void AddResource(Handle theData, ResType theType, short theID, ConstStr255Param name)
  331. ;
  332.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  333.         _AddResource:    OPWORD    $A9AB
  334.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  335.         IMPORT_CFM_FUNCTION AddResource
  336.     ENDIF
  337.  
  338. ;
  339. ; pascal long GetResourceSizeOnDisk(Handle theResource)
  340. ;
  341.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  342.         _GetResourceSizeOnDisk:    OPWORD    $A9A5
  343.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  344.         IMPORT_CFM_FUNCTION GetResourceSizeOnDisk
  345.     ENDIF
  346.  
  347. ;
  348. ; pascal long GetMaxResourceSize(Handle theResource)
  349. ;
  350.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  351.         _GetMaxResourceSize:    OPWORD    $A821
  352.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  353.         IMPORT_CFM_FUNCTION GetMaxResourceSize
  354.     ENDIF
  355.  
  356. ;
  357. ; pascal long RsrcMapEntry(Handle theResource)
  358. ;
  359.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  360.         _RsrcMapEntry:    OPWORD    $A9C5
  361.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  362.         IMPORT_CFM_FUNCTION RsrcMapEntry
  363.     ENDIF
  364.  
  365. ;
  366. ; pascal void SetResAttrs(Handle theResource, short attrs)
  367. ;
  368.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  369.         _SetResAttrs:    OPWORD    $A9A7
  370.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  371.         IMPORT_CFM_FUNCTION SetResAttrs
  372.     ENDIF
  373.  
  374. ;
  375. ; pascal void ChangedResource(Handle theResource)
  376. ;
  377.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  378.         _ChangedResource:    OPWORD    $A9AA
  379.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  380.         IMPORT_CFM_FUNCTION ChangedResource
  381.     ENDIF
  382.  
  383. ;
  384. ; pascal void RemoveResource(Handle theResource)
  385. ;
  386.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  387.         _RemoveResource:    OPWORD    $A9AD
  388.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  389.         IMPORT_CFM_FUNCTION RemoveResource
  390.     ENDIF
  391.  
  392. ;
  393. ; pascal void UpdateResFile(short refNum)
  394. ;
  395.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  396.         _UpdateResFile:    OPWORD    $A999
  397.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  398.         IMPORT_CFM_FUNCTION UpdateResFile
  399.     ENDIF
  400.  
  401. ;
  402. ; pascal void WriteResource(Handle theResource)
  403. ;
  404.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  405.         _WriteResource:    OPWORD    $A9B0
  406.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  407.         IMPORT_CFM_FUNCTION WriteResource
  408.     ENDIF
  409.  
  410. ;
  411. ; pascal void SetResPurge(Boolean install)
  412. ;
  413.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  414.         _SetResPurge:    OPWORD    $A993
  415.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  416.         IMPORT_CFM_FUNCTION SetResPurge
  417.     ENDIF
  418.  
  419. ;
  420. ; pascal short GetResFileAttrs(short refNum)
  421. ;
  422.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  423.         _GetResFileAttrs:    OPWORD    $A9F6
  424.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  425.         IMPORT_CFM_FUNCTION GetResFileAttrs
  426.     ENDIF
  427.  
  428. ;
  429. ; pascal void SetResFileAttrs(short refNum, short attrs)
  430. ;
  431.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  432.         _SetResFileAttrs:    OPWORD    $A9F7
  433.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  434.         IMPORT_CFM_FUNCTION SetResFileAttrs
  435.     ENDIF
  436.  
  437. ;
  438. ; pascal short OpenRFPerm(ConstStr255Param fileName, short vRefNum, SInt8 permission)
  439. ;
  440.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  441.         _OpenRFPerm:    OPWORD    $A9C4
  442.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  443.         IMPORT_CFM_FUNCTION OpenRFPerm
  444.     ENDIF
  445.  
  446. ;
  447. ; pascal Handle RGetResource(ResType theType, short theID)
  448. ;
  449.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  450.         _RGetResource:    OPWORD    $A80C
  451.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  452.         IMPORT_CFM_FUNCTION RGetResource
  453.     ENDIF
  454.  
  455. ;    Note:     The HOpenResFile trap was not implemented until System 7.  If you want to call HOpenResFile
  456. ;            while running on System 6 machines, then define USE_HOPENRESFILE_GLUE and link with
  457. ;            Interface.o which contains glue to implement HOpenResFile on pre-System 7 machines.
  458. ;
  459.  
  460.     IF &TYPE('USE_HOPENRESFILE_GLUE') <> 'UNDEFINED' THEN
  461. ;
  462. ; pascal short HOpenResFile(short vRefNum, long dirID, ConstStr255Param fileName, SInt8 permission)
  463. ;
  464.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  465.         IMPORT_CFM_FUNCTION HOpenResFile
  466.     ENDIF
  467.  
  468.     ELSE
  469. ;
  470. ; pascal short HOpenResFile(short vRefNum, long dirID, ConstStr255Param fileName, SInt8 permission)
  471. ;
  472.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  473.         _HOpenResFile:    OPWORD    $A81A
  474.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  475.         IMPORT_CFM_FUNCTION HOpenResFile
  476.     ENDIF
  477.  
  478.     ENDIF
  479. ;    Note:     The HCreateResFile trap was not implemented until System 7.  If you want to call HCreateResFile
  480. ;            while running on System 6 machines, then define USE_HCREATERESFILE_GLUE and link with
  481. ;            Interface.o which contains glue to implement HCreateResFile on pre-System 7 machines.
  482. ;
  483.  
  484.     IF &TYPE('USE_HCREATERESFILE_GLUE') <> 'UNDEFINED' THEN
  485. ;
  486. ; pascal void HCreateResFile(short vRefNum, long dirID, ConstStr255Param fileName)
  487. ;
  488.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  489.         IMPORT_CFM_FUNCTION HCreateResFile
  490.     ENDIF
  491.  
  492.     ELSE
  493. ;
  494. ; pascal void HCreateResFile(short vRefNum, long dirID, ConstStr255Param fileName)
  495. ;
  496.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  497.         _HCreateResFile:    OPWORD    $A81B
  498.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  499.         IMPORT_CFM_FUNCTION HCreateResFile
  500.     ENDIF
  501.  
  502.     ENDIF
  503. ;
  504. ; pascal short FSpOpenResFile(const FSSpec *spec, SignedByte permission)
  505. ;
  506.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  507.         Macro
  508.         _FSpOpenResFile
  509.             moveq               #13,D0
  510.             dc.w                $AA52
  511.         EndM
  512.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  513.         IMPORT_CFM_FUNCTION FSpOpenResFile
  514.     ENDIF
  515.  
  516. ;
  517. ; pascal void FSpCreateResFile(const FSSpec *spec, OSType creator, OSType fileType, ScriptCode scriptTag)
  518. ;
  519.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  520.         Macro
  521.         _FSpCreateResFile
  522.             moveq               #14,D0
  523.             dc.w                $AA52
  524.         EndM
  525.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  526.         IMPORT_CFM_FUNCTION FSpCreateResFile
  527.     ENDIF
  528.  
  529. ;
  530. ; pascal void ReadPartialResource(Handle theResource, long offset, void *buffer, long count)
  531. ;
  532.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  533.         Macro
  534.         _ReadPartialResource
  535.             moveq               #1,D0
  536.             dc.w                $A822
  537.         EndM
  538.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  539.         IMPORT_CFM_FUNCTION ReadPartialResource
  540.     ENDIF
  541.  
  542. ;
  543. ; pascal void WritePartialResource(Handle theResource, long offset, const void *buffer, long count)
  544. ;
  545.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  546.         Macro
  547.         _WritePartialResource
  548.             moveq               #2,D0
  549.             dc.w                $A822
  550.         EndM
  551.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  552.         IMPORT_CFM_FUNCTION WritePartialResource
  553.     ENDIF
  554.  
  555. ;
  556. ; pascal void SetResourceSize(Handle theResource, long newSize)
  557. ;
  558.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  559.         Macro
  560.         _SetResourceSize
  561.             moveq               #3,D0
  562.             dc.w                $A822
  563.         EndM
  564.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  565.         IMPORT_CFM_FUNCTION SetResourceSize
  566.     ENDIF
  567.  
  568. ;
  569. ; pascal Handle GetNextFOND(Handle fondHandle)
  570. ;
  571.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  572.         Macro
  573.         _GetNextFOND
  574.             moveq               #10,D0
  575.             dc.w                $A822
  576.         EndM
  577.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  578.         IMPORT_CFM_FUNCTION GetNextFOND
  579.     ENDIF
  580.  
  581.  
  582.     IF ¬ TARGET_OS_MAC THEN
  583. ;  QuickTime 3.0
  584. ;
  585. ; extern OSErr RegisterResourceEndianFilter(ResType theType, ResourceEndianFilterPtr theFilterProc)
  586. ;
  587.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  588.         IMPORT_CFM_FUNCTION RegisterResourceEndianFilter
  589.     ENDIF
  590.  
  591.     ENDIF
  592. ;  Use TempInsertROMMap to force the ROM resource map to be
  593. ;   inserted into the chain in front of the system. Note that
  594. ;   this call is only temporary - the modified resource chain
  595. ;   is only used for the next call to the resource manager.
  596. ;   See IM IV 19 for more information. 
  597. ;
  598.  
  599. ;
  600. ; pascal void TempInsertROMMap(Boolean tempResLoad)
  601. ;
  602.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  603.         Macro
  604.         _TempInsertROMMap
  605.             moveq               #-1,D0
  606.             dc.w                $4A1F
  607.             dc.w                $56C0
  608.             dc.w                $31C0
  609.             dc.w                $0B9E
  610.         EndM
  611.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  612.         IMPORT_CFM_FUNCTION TempInsertROMMap
  613.     ENDIF
  614.  
  615.  
  616.     IF OLDROUTINENAMES THEN
  617.  
  618.     ENDIF    ; OLDROUTINENAMES
  619. ;    These typedefs were originally created for the Copland Resource Mangager
  620. ;
  621.  
  622. ; typedef short                         ResFileRefNum
  623.  
  624. ; typedef short                         ResID
  625.  
  626. ; typedef short                         ResAttributes
  627.  
  628. ; typedef short                         ResFileAttributes
  629.  
  630.  
  631.  
  632.     ENDIF ; __RESOURCES__ 
  633.  
  634.